<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style >
        #box1{
            width: 100px;
            height: 100px;background: red;position: absolute;}
        #box2{
            width: 100px;
            height: 100px;background: blue;position: fixed;left:0;top:0}
    </style>
    <script src="js/jquery-1.12.3.js"></script>
</head>
<body>
    <div id="box1"></div>
<div id="box2">我是fixed</div>
</body>
</html>
<script>
    $(function () {
        $("#box1").css("z-index",999)
    })
</script>